#include <stdio.h>
#include <unistd.h>

#include "threadPool.h"

void test_threadpool(void *args)
{
    int *num = (int *)args;
    printf("start [%d]\n", *num);
    int count = 100;
    while (count--)
    {
        (*num)++;
    }
    printf("end [%d]\n", *num);
}

int main()
{
    threadpool_t *pool = threadpool_create(5);
    int num = 0;
    while (1)
    {
        threadpool_post(pool, test_threadpool, (void *)&num);
        sleep(1);
    }

    return 0;
}